<template>
  <div>
    <h3>姓名：<input type="text" v-model="propsCopy.name" /></h3>
    <h3>年龄：<input type="text" v-model="propsCopy.age" /></h3>
    <h3>性别：<input type="text" v-model="propsCopy.sex" /></h3>
    <h3>爱好：<input type="text" v-model="propsCopy.hobby" /></h3>
    <button @click="submit">点击提交</button>
  </div>
</template>

<script>
export default {
  name: "Son",
  props: {
    name: String,
    age: String,
    sex: String,
    hobby: String,
    changeData:Function
  },
  data() {
    return {
      propsCopy: {
        name: this.name,
        age: this.age,
        sex: this.sex,
        hobby: this.hobby,
      },
    };
  },
  methods: {
    submit() {
      this.changeData(this.propsCopy)
    },
  },
};
</script>

<style>
</style>